package org.apache.flink.runtime.client;

import org.apache.flink.api.common.ConsumerID;
import org.apache.flink.util.ERException;

/**
 * This exception is the base exception for all exceptions that denote any failure during the
 * consume of a resource.
 */
public class ConsumeException extends ERException {

    private static final long serialVersionUID = 2818087325120827525L;

    private final ConsumerID jobID;

    /**
     * Constructs a new job execution exception.
     *
     * @param jobID The job's ID.
     * @param msg The cause for the execution exception.
     * @param cause The cause of the exception
     */
    public ConsumeException(ConsumerID jobID, String msg, Throwable cause) {
        super(msg, cause);
        this.jobID = jobID;
    }

    public ConsumeException(ConsumerID jobID, String msg) {
        super(msg);
        this.jobID = jobID;
    }

    public ConsumeException(ConsumerID jobID, Throwable cause) {
        super(cause);
        this.jobID = jobID;
    }

    public ConsumerID getJobID() {
        return jobID;
    }
}
